package C07.example01;
import C07.example01.service.StudentService;

import java.util.Scanner;

public class StudentManagerDemo3 {
    Scanner scanner = new Scanner(System.in);
    StudentService studentService = new StudentService();

    public static void main(String[] args) {
        StudentManagerDemo3 studentManagerDemo03 = new StudentManagerDemo3();
        studentManagerDemo03.init();

    }

    private void init(){
        while (true){
            System.out.println("选择(1、录入;)");
            System.out.println("(0、退出;)");
            int choice = scanner.nextInt();
            if (choice == 1){
                studentService.add();
            } else if (choice == 0) {
                studentService.printStudent();
                scanner.close();
                break;
            }
        }
    }

}